﻿using System;
using AutoMapper;
using Elasticsearch.Synchronize.Domain.Aggregates.SynchronizeAggregate;
using Elasticsearch.Synchronize.Repository.MongoDbDTO;

namespace Elasticsearch.Synchronize.Job.AutoMapper
{
    public class SimpleMapProfile : Profile
    {
        public SimpleMapProfile()
        {
            CreateMap<SynchronizeItemDTO, SynchronizeItem>()
                .ForMember(d => d.Identity, s => s.MapFrom(o => o.ItemId));

            CreateMap<SynchronizeItem, SynchronizeItemDTO>()
                .ForMember(d => d.ItemId, s => s.MapFrom(o => o.Identity));

            CreateMap<SynchronizeRuleDTO, SynchronizeRule>()
                .ForMember(d => d.Identity, s => s.MapFrom(o => o.RuleId));
        }
    }
}